$(function() {
	$( ".datepicker" ).datepicker({
		showOn: "button",
		buttonImage: "images/calendar.gif",
		buttonImageOnly: true
	});
	
	$(".save-btn").button({
		icons: {
			primary: "ui-icon-check"
		}
	});
	
	$(".reset-btn").button({
		icons: {
			primary: "ui-icon-arrowrefresh-1-e"
		}
	});
	
	$(".search-btn").button({
		icons: {
			primary: "ui-icon-search"
		}
	});
 
	$(".prev-btn").button({
		icons: {
			primary: "ui-icon-carat-1-w"
		}
	});
	
	$(".next-btn").button({
		icons: {
			primary: "ui-icon-carat-1-e"
		}
	});

	$(".delete-btn").button({
		icons: {
			primary: "ui-icon-arrowrefresh-1-e"
		}
	});
	
	$(".close-btn").button({
		icons: {
			primary: "ui-icon-close"
		}
	});	
	
	$('.readonly').attr('readonly', true);
	
	$( ".selectable ol" ).selectable();
});

function move_seleted(from, to, all){
	if(!all) {
		$moved_objects = $(from + " > ol > li.ui-selected");
	} else {
		$moved_objects = $(from + " > ol > li");
	}
	// $(from).remove('.ui-selected');
	$.each($moved_objects, function(index,object) {
		//alert(object);
		$added_object = $(object).clone();
		$(to + " > ol").append($added_object);
		$(object).remove();
	})
	
	return false;
}
